<template>
  <el-dialog width="1000px" title="反欺诈结果" :visible.sync="dialogVisible" :close-on-click-modal="false">
    <el-descriptions title="用户信息" direction="vertical" :column="5" border>
      <el-descriptions-item label="订单ID"> {{ dataList.order_id }}</el-descriptions-item>
      <el-descriptions-item label="姓名"> {{ dataList.cert_name }}</el-descriptions-item>
      <el-descriptions-item label="身份证号"> {{ dataList.cert_no }}</el-descriptions-item>
      <el-descriptions-item label="手机号码"> {{ dataList.mobile }}</el-descriptions-item>
      <el-descriptions-item label="手机在网时长"> {{  getTimes(dataList.time_online) }}</el-descriptions-item>
    </el-descriptions>
    <br>
    <el-descriptions title="反欺诈结果建议" direction="vertical" :column="5" border>
      <el-descriptions-item label="订单押金"> {{ dataList.fraud_price }}</el-descriptions-item>
      <el-descriptions-item label="预授权押金"> {{ dataList.setmeal_foregift }}</el-descriptions-item>
      <el-descriptions-item label="押金建议"> {{ dataList.suggest_cash }}</el-descriptions-item>
      <el-descriptions-item label="联系人二要素是否一致"> {{ dataList.order_mobile_result==2?'一致':'不一致' }}</el-descriptions-item>
      <el-descriptions-item label="其他不同下单人的订单联系人相同"> {{ dataList.order_mobile_fraud==''?'符合要求':'疑似欺诈' }}</el-descriptions-item>
    </el-descriptions>
    <br>
    <br>
    <el-descriptions title="关联风险检测" direction="vertical" :column="5" border>
      <el-descriptions-item label="3个月身份证关联手机号次数"> {{ dataList.m3_idcard_to_phone_time }}</el-descriptions-item>
      <el-descriptions-item label="3个月手机号关联身份证次数"> {{ dataList.m3_phone_to_idcard_time }}</el-descriptions-item>
    </el-descriptions>
    <br>
    <el-descriptions title="风险名单检测" direction="vertical" :column="4" border>
      <el-descriptions-item label="信用租赁风险名单" contentClassName="">{{ dataList.credit_rent }}</el-descriptions-item>
      <el-descriptions-item label="特殊关注名单" contentClassName="">{{ dataList.result_xd }}</el-descriptions-item>
      <el-descriptions-item label="犯罪通缉名单" contentClassName="">{{ dataList.idcard_hit_fztj }}</el-descriptions-item>
      <el-descriptions-item label="虚拟号码库" contentClassName=" ">{{ dataList.phone_hit_xjhm }}</el-descriptions-item>
      <el-descriptions-item label="通信小号库" contentClassName=" ">{{ dataList.phone_hit_txxh }}</el-descriptions-item>
      <el-descriptions-item label="归属地位于高风险集中地区" contentClassName=" ">{{ dataList.census_register_high_risk_area
      }}</el-descriptions-item>
      <el-descriptions-item label="车辆租赁违约名单" contentClassName=" ">{{ dataList.idcard_hit_clzlwy }}</el-descriptions-item>
      <el-descriptions-item label="故意违章乘车名单" contentClassName="  ">{{ dataList.idcard_hit_gywzcc }}</el-descriptions-item>
    </el-descriptions>
    <br>
    <el-descriptions title="贷款申请信息" direction="vertical" :column="5" border>
      <el-descriptions-item label="近1个月申请次数"> {{ dataList.apply_time1 }}</el-descriptions-item>
      <el-descriptions-item label="近3个月申请次数"> {{ dataList.apply_time3 }}</el-descriptions-item>
      <el-descriptions-item label="近12个月申请次数"> {{ dataList.apply_time12 }}</el-descriptions-item>
    </el-descriptions>
    <br>
    <el-descriptions title="历史逾期记录" direction="vertical" :column="4" border>
      <el-descriptions-item label="近6个月逾期机构总数"> {{ dataList.overdue_mechanism_number }}</el-descriptions-item>
      <el-descriptions-item label="近6个月逾期总次数"> {{ dataList.counts }}</el-descriptions-item>
      <el-descriptions-item label="近6个月逾期总金额（元）"> {{ dataList.overdue_money }}</el-descriptions-item>
      <el-descriptions-item label="近6个月逾期未结清次数"> {{ dataList.uncleared_counts }}</el-descriptions-item>
    </el-descriptions>
    <br><br>
    <el-descriptions title="租赁行为" direction="vertical" :column="5" border>
      <el-descriptions-item label="近3个月申请租赁次数"> {{ dataList.m3_apply_time }}</el-descriptions-item>
    </el-descriptions>
    <br>
    <br>
    <el-descriptions title="法院风险行为" direction="vertical" :column="5" border>
      <el-descriptions-item label="法院风险信息"> {{ dataList.court_risk_info_list==''?'暂无法院风险信息':'命中' }}</el-descriptions-item>
    </el-descriptions>
    <br>
    <div slot="footer" class="dialog-footer">
      <el-button size="small" @click="dialogVisible = false">取 消</el-button>
      <el-button size="small" type="primary" @click="submit">确 定</el-button>
    </div>
  </el-dialog>
</template>

<script>
import { getFraudData } from '@/api/order'
export default {
  // props: ['orderId'],
  props: {
    orderId: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      dataList: {},
      dialogVisible: false
    }
  },
  watch: {
    dialogVisible(val) {
      if (val) {
        getFraudData(this.orderId).then(res => {
          this.dataList = res
          console.log(res);
        })

      } else {
        this.$refs['ruleForm'].resetFields()
      }
    }
  },
  methods: {
    getTimes(item){
      if(item==1){
        return '3个月'
      }else if(item==2){
        return '3-6个月'
      }else if(item==3){
        return '6-12个月'
      }else if(item==4){
        return '12-24个月'
      }else if(item==5){
        return '24个月以上'
      }else if(item==0){
        return '查无记录'
      }else {
        return '不⽀持该运营商'
      }
    }
  }
}
</script>

<style lang="scss" scoped></style>
